# coding=utf-8
# Date: 2021/8/31 9:30
from typing import List


class Solution:
    def corpFlightBookings(self, bookings: List[List[int]], n: int) -> List[int]:
        t = [0] * (n + 10)
        for item in bookings:
            a, b, w = item[0], item[1], item[2]
            t[a] += w
            t[b + 1] -= w
        res = []
        for i in range(1, n + 1):
            t[i] += t[i - 1]
            res.append(t[i])
        return res


if __name__ == "__main__":
    print(Solution().corpFlightBookings([[1, 2, 10], [2, 3, 20], [2, 5, 25]], 5))
